package com.alifi.crm.dal.score;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.alifi.crm.dal.IbatisCRUDDAO;
import com.alifi.crm.dal.enu.States;
import com.alifi.crm.dal.object.EmployeeScoreDO;



@Repository("employeeScoreDAO")
public class EmployeeScoreDAOImpl extends IbatisCRUDDAO<EmployeeScoreDO> implements EmployeeScoreDAO{

	@Override
	protected String getNamespace() {
		return "act_employee_score";
	}
	
	@Override
	public EmployeeScoreDO selectByEmployeeNum(String employeeNum) {
		Map<String,String> map = new HashMap<String,String>();
		map.put("employeeNum", employeeNum);
		return (EmployeeScoreDO)this.getSqlMapClientTemplate().queryForObject(this.genStmt("selectByEmployeeNum"),map);
	}

	
	@Override
	public void updateScore(States scoreStates, String employeeNum,
			Long signScore, Long payScore, Long amountScore, Long wholeScore) {
		Map<String,Object> map = new HashMap<String,Object>();
		map.put("scoreStates", scoreStates.code());
		map.put("employeeNum", employeeNum);
		map.put("signScore", signScore);
		map.put("payScore", payScore);
		map.put("amountScore", amountScore);
		map.put("wholeScore", wholeScore);
		this.getSqlMapClientTemplate().update(this.genStmt("updateScore"),map);
		
	}
	

}
